<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of WebUser
 *
 * @author Tartharia
 */
class WebUser extends CWebUser
{
    private $_userole = null;
 
    public function getRole()
    {
        if($user = $this->getModel())
            return $user->userole;
    }
 
    private function getModel()
    {
        if (!$this->isGuest && $this->_userole === null)
            $this->_userole = User::model()->findByPk($this->id, array('select' => 'userole'));
        return $this->_userole;        
    }
}

?>
